#include "BaseResult.h"

BaseResult::BaseResult(int retVal, QString retStr) {
    this->retVal = retVal;
    this->retStr = retStr;
}

BaseResult::BaseResult(int retVal, QString retStr, QJsonObject retObj) {
    this->retVal = retVal;
    this->retStr = retStr;
    this->retObj = retObj;
}

BaseResult::~BaseResult() {}


BaseResult::JsonResult BaseResult::toJson() {
    QJsonObject json;
    json.insert(QStringLiteral("retVal"), this->retVal);
    json.insert(QStringLiteral("retStr"), this->retStr);
    json.insert(QStringLiteral("retObj"), this->retObj);
    QJsonDocument document(json);
    return BaseResult::JsonResult(document.toJson());
}
